using System;

namespace Avanzis.QueryObjects
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false), Serializable]
    public abstract class ColumnPropertyAttribute : System.Attribute
    {
        private String column;
        private String columnType;

        /// <summary>
        /// Initializes a new instance of the <see cref="T:PropertyAttribute"/> class.
        /// </summary>
        public ColumnPropertyAttribute()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="T:PropertyAttribute"/> class.
        /// </summary>
        /// <param name="fieldName">Name of the field.</param>
        public ColumnPropertyAttribute(string column)
        {
            this.column = column;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="T:PropertyAttribute"/> class.
        /// </summary>
        /// <param name="fieldName">Name of the field.</param>
        public ColumnPropertyAttribute(string column, string columnType)
        {
            this.column = column;
            this.columnType = columnType;
        }
        
        /// <summary>
        /// Gets or sets the name of the field.
        /// </summary>
        /// <value>The name of the field.</value>
        public string Column
        {
            get { return column;}
            set { column = value;}
        }

        /// <summary>
        /// Gets or sets the type of the column.
        /// </summary>
        /// <value>The type of the column.</value>
        public string ColumnType
        {
            get { return columnType; }
            set { columnType = value; }
        }
    }
}
